package entity;

import lombok.Getter;
import lombok.ToString;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: torlesse-liang
 * @Date: 2022/04/16/0:49
 * @Description: 返回结果枚举
 */
@Getter
@ToString
public enum ResultCodeEnum {

    SUCCESS(true, 20000, "成功"),
    UNKNOWN_REASON(false, 20001, "未知错误"),

    QUERY_SUCCESS(true,20002,"查询成功"),
    QUERY_ERROR(false,20003,"查询失败"),

    UPDATE_SUCCESS(true,20004,"更新成功"),
    UPDATE_ERROR(false,20005,"更新失败"),

    INSERT_SUCCESS(true,20006,"新增成功"),
    INSERT_ERROR(false,20007,"新增失败"),

    DELETE_SUCCESS(true,20008,"删除成功"),
    DELETE_ERROR(false,20009,"删除失败"),

    LOGIN_SUCCESS(false, 21000, "登录成功"),
    LOGIN_ERROR(false, 21001, "登录失败"),

    LOGIN_PHONE_ERROR(false, 21002, "手机号码不正确"),
    LOGIN_MOBILE_ERROR(false, 21003, "账号不正确"),
    LOGIN_PASSWORD_ERROR(false, 21004, "密码不正确"),
    LOGIN_DISABLED_ERROR(false, 21005, "该用户已被禁用"),
    REGISTER_MOBLE_ERROR(false, 21006, "手机号已被注册"),
    LOGIN_AUTH(false, 21007, "需要登录"),
    LOGIN_ACL(false, 21008, "没有权限"),
    SMS_SEND_ERROR(false, 21009, "短信发送失败"),
    SMS_SEND_ERROR_BUSINESS_LIMIT_CONTROL(false, 21010, "短信发送过于频繁"),

    PARAM_ERROR(false, 21011, "参数不正确"),

    FILE_UPLOAD_ERROR(false, 21012, "文件上传失败"),
    FILE_DELETE_ERROR(false, 21013, "文件刪除失败"),
    EXCEL_DATA_IMPORT_ERROR(false, 21014, "Excel数据导入错误"),

    FETCH_ACCESSTOKEN_FAILD(false, 21015, "获取accessToken失败"),
    FETCH_USERINFO_ERROR(false, 21016, "获取用户信息失败"),


    GATEWAY_ERROR(false, 21017, "服务不能访问"),

    CODE_ERROR(false, 21018, "验证码错误"),

    REGISTER_SUCCESS(false, 21019, "注册成功"),
    REGISTER_ERROR(false, 21020, "注册失败"),

    PARAM_EMPTY(false,21022,"参数不能为空"),
    EMAIL_SEND_SUCCESS(false,21023,"参数不能为空"),
    FILE_UPLOAD_SUCCESS(false,21024,"文件上传成功"),
    SMS_SEND_SUCCESS(false,21025,"短信验证码发送成功"),

    SERVER_ERROR(false,22000,"服务器异常");

    private final Boolean success;

    private final Integer code;

    private final String message;

    ResultCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }
}
